export const getDictCustomStyle = (dict: any[], value: any) => {
  const item = dict.find((item) => item.value === value);
  return item ? item.customStyle : {};
};

export const getLocaleDateTime = (utcVal: string) => {
  const utcDate = new Date(utcVal);
  const localeDate = new Date(utcDate.getTime() - utcDate.getTimezoneOffset() * 60 * 1000);
  const y = localeDate.getFullYear();
  const m = `0${localeDate.getMonth() + 1}`.slice(-2);
  const day = `0${localeDate.getDate()}`.slice(-2);
  const h = `0${localeDate.getHours()}`.slice(-2);
  const min = `0${localeDate.getMinutes()}`.slice(-2);
  const s = `0${localeDate.getSeconds()}`.slice(-2);
  return `${y}-${m}-${day} ${h}:${min}:${s}`;
};
